#include <iostream>

using namespace std;

int main()
{
    cout << "\n输入要转换的字符 ==> ";

    char c;
    cin >> c;   // A

    int i = c;

    cout << "\n字符 " << c << " 是 ";
    cout << dec << i << "(10进制) ";
    cout << oct << i << "(8进制) ";         // 小心,用setf不行,还是10进制
    cout << hex << i << "(16进制)" << endl;
}

// g++ -m32 -O3 -fexec-charset=GBK ch02/2_15.cpp && ./a
